<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateRepayReliefRecordsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('repay_relief_records', function (Blueprint $table) {
            $table->charset = 'utf8';
            $table->collation = 'utf8_general_ci';
            $table->comment = '还款减免记录表';
            $table->increments('id')->comment('主键');
            $table->string('loan_id',100)->default('')->comment('新流订单号');
            $table->unsignedTinyInteger('period')->comment('当前期数');
            $table->unsignedInteger('relief_amount')->default(0)->comment('减免金额,以分为单位');
            $table->unsignedTinyInteger('status')->default(1)->comment('减免状态 1:未使用 2:已过期 3:使用');
            $table->timestamp('deadline')->nullable()->comment('截止时间');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('repay_relief_records');
    }
}
